import { IPoint, IViewer } from "./Type";

export class Square {
  private _viewer?: IViewer;
  private _point: IPoint = {
    x: 0,
    y: 0,
  };
  private _color: string = "#0ff";

  get point() {
    return this._point;
  }

  set point(val) {
    this._point = val;
    if (this._viewer) {
      this._viewer.show();
    }
  }

  get color() {
    return this._color;
  }

  set color(val) {
    this._color = val;
  }

  get viewer() {
    return this._viewer;
  }

  set viewer(val) {
    this._viewer = val;
    this._viewer?.show();
  }
}
